package com.ocean.controller.library;

import com.ocean.entity.library.Announcement;
import com.ocean.entity.library.Book;
import com.ocean.service.library.AnnouncementService;
import com.ocean.service.library.BookService;
import com.ocean.service.library.CategoryService;
import com.ocean.service.library.LibraryService;
import com.ocean.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Project：SchoolManage
 * Package：com.ocean.controller.library
 * Author:zy
 * Time:2023/3/3
 */
@RestController
@RequestMapping("/api/library/announcement")
public class AnnouncementController {
    @Autowired
    private AnnouncementService announcementService;


    @PostMapping("save.do")
    public R save(@RequestBody Announcement announcement){
        return announcementService.save(announcement);
    }

    @RequestMapping("querypage.do")
    public R queryPage(int page, int size,String title,String content){

        return announcementService.queryPage(page,size,title,content);
    }

    @GetMapping("del.do")
    public R delete(int id){

        return announcementService.delete(id);
    }



    @PostMapping("update.do")
    public R update(@RequestBody Announcement announcement){

        return announcementService.update(announcement);
    }
}
